package com.mumulx.check.web.config;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class BeanConfig {
    @Bean
    @LoadBalanced //默认采用轮询的方式进行负载均衡
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }

    /*//负载均衡实现RestTemplate
    @Bean
    @LoadBalanced       //Reibbon
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }




//规则，轮询
    @Bean
    public IRule myRule(){
        return new RandomRule();
    }*/

}


